Expand description
The deunicode
library transliterates Unicode strings such as “Æneid” into pure
ASCII ones such as “AEneid.”
Supports no-std. Stores Unicode data in a compact format.
It started as a Rust port of Text::Unidecode
Perl module, and was extended to support emoji.
See README for more info.
§Examples
use deunicode::deunicode;
assert_eq!(deunicode("Æneid"), "AEneid");
assert_eq!(deunicode("étude"), "etude");
assert_eq!(deunicode("北亰"), "Bei Jing");
assert_eq!(deunicode("ᔕᓇᓇ"), "shanana");
assert_eq!(deunicode("げんまい茶"), "genmaiCha");
assert_eq!(deunicode("🦄☣"), "unicorn biohazard");
assert_eq!(deunicode("…"), "...");
// format without a temporary string
use deunicode::AsciiChars;
format!("what's up {}", "🐶".ascii_chars());
Structs§
- Iterator that translates Unicode characters to ASCII strings.
Traits§
- Convenience functions for deunicode.
use deunicode::AsciiChars
Functions§
- This function takes any Unicode string and returns an ASCII transliteration of that string.
- This function takes a single Unicode character and returns an ASCII transliteration.
- Same as
deunicode()
, but unknown characters can be replaced with a custom string. - Same as
deunicode_with_tofu()
, but avoids allocating a newString
if not necessary.